/*******************************************************************************
 *
 *    Copyright (c) Baina Info Tech Co. Ltd
 *
 *    My_Jamendo_music
 *    
 *    ExitDialog
 *    TODO File description or class description.
 *
 *    @author: zuochen
 *    @since:  2011-1-27
 *    @version: 1.0
 *
 ******************************************************************************/

package small.hero.entertaiment.radio.jiujie.version.zl.widget;

import small.hero.entertaiment.radio.jiujie.version.zl.R;
import small.hero.entertaiment.radio.jiujie.version.zl.activity.RadioActivity;
import android.app.Dialog;
import android.content.Context;
import android.os.Handler;
import android.view.View;
import android.view.Window;

/**
 * ExitDialog of My_Jamendo_music.
 * 
 * @author zuochen
 * 
 */

public class ExitDialog extends Dialog implements
		android.view.View.OnClickListener {
	private final Handler mHandler;

	/**
	 * Initiate a new instance of {@link ExitDialog}.
	 * 
	 * @param context
	 */
	public ExitDialog(Context context, Handler mHandler) {
		super(context);
		this.mHandler = mHandler;
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.dialog_exit);
		// findViewById(R.id.mim).setOnClickListener(this);
		findViewById(R.id.exit).setOnClickListener(this);
		findViewById(R.id.cancel).setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		// case R.id.mim:
		// mHandler.sendEmptyMessage(MusicTabActivity.MSG_MIN);
		// break;
		case R.id.exit:
			mHandler.sendEmptyMessage(RadioActivity.MSG_EXIT);
			break;
		case R.id.cancel:
			break;
		}
		dismiss();
	}
}
